package com.ssm.pre.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import com.ssm.pre.service.RepairService;
import com.ssm.util.object.InputObject;
import com.ssm.util.object.OutputObject;

@Controller
public class RepairController {
	
	@Autowired
	private RepairService repairService;
	
	/**
	 * 查詢故障报修单列表
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/RepairController/queryRepairList")
	@ResponseBody
	public void queryRepairList(InputObject inputObject ,OutputObject outputObject) throws Exception{
		repairService.queryRepairList(inputObject, outputObject);
		
	}
	
	/**
	 * 增加故障报修单
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/RepairController/addRepair")
	@ResponseBody
	public void addRepair(InputObject inputObject ,OutputObject outputObject) throws Exception{
		repairService.addRepair(inputObject, outputObject);
	}
	
	/**
	 * 修改故障报修单
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/RepairController/editRepair")
	@ResponseBody
	public void editRepair(InputObject inputObject ,OutputObject outputObject) throws Exception{
		repairService.editRepair(inputObject, outputObject);;
	}
	/**
	 * 删除故障报修单
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/RepairController/deleteRepairById")
	@ResponseBody
	public void deleteRepairById(InputObject inputObject ,OutputObject outputObject) throws Exception{
		repairService.deleteRepairById(inputObject, outputObject);
	}
	
	/**
	 * 查询一条故障报修单
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/RepairController/findRepairById")
	@ResponseBody
	public void findRepairById(InputObject inputObject ,OutputObject outputObject) throws Exception{
		repairService.findRepairById(inputObject, outputObject);
	}
	
	/**
	 * 
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/RepairController/queryRoomNumByOneSelect")
	@ResponseBody
	public void queryRoomNumByOneSelect(InputObject inputObject ,OutputObject outputObject) throws Exception{
		repairService.queryRoomNumByOneSelect(inputObject, outputObject);
	}
	
	/**
	 * 微信端增加故障报修单
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/gateway/RepairController/addWechatRepair")
	@ResponseBody
	public void addWechatRepair(InputObject inputObject ,OutputObject outputObject) throws Exception{
		repairService.addWechatRepair(inputObject, outputObject);
	}
	
	/**
	 * 查询infoName下拉列表
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/RepairController/queryinfoNameByfaultId")
	@ResponseBody
	public void queryinfoNameByfaultId(InputObject inputObject ,OutputObject outputObject) throws Exception{
		repairService.queryinfoNameByfaultId(inputObject, outputObject);
	}
	
	/**
	 * 查询故障类型下拉列表
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/RepairController/queryfaultNameList")
	@ResponseBody
	public void queryfaultNameList(InputObject inputObject ,OutputObject outputObject) throws Exception{
		repairService.queryfaultNameList(inputObject, outputObject);
	}
	
	/**
	 * 微信端增加个人故障报修图片
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/gateway/RepairController/addWechatImg")
	@ResponseBody
	public void addWechatImg(InputObject inputObject,OutputObject outputObject,@RequestParam("ImageZero") CommonsMultipartFile files) throws Exception {
		repairService.addWechatImg(inputObject, outputObject,files);
	} 
	/**
	 * 微信端增加公共故障报修图片
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/gateway/RepairController/addWechatPublicImg")
	@ResponseBody
	public void addWechatPublicImg(InputObject inputObject,OutputObject outputObject,@RequestParam("publicImageOne") CommonsMultipartFile files) throws Exception {
		repairService.addWechatImg(inputObject, outputObject,files);
	} 
	
	/**
	 * 根据faultName查找维修人
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/RepairController/queryserviceManNameByfaultName")
	@ResponseBody
	public void queryserviceManNameByfaultName(InputObject inputObject ,OutputObject outputObject) throws Exception{
		repairService.queryserviceManNameByfaultName(inputObject, outputObject);
	}
	
	/**
	 * 查询报修记录
	 * @param inputObject
	 * @param outputObject
	 * @throws Exception
	 */
	@RequestMapping("/post/RepairController/queryrepairRecord")
	@ResponseBody
	public void queryrepairRecord(InputObject inputObject ,OutputObject outputObject) throws Exception{
		repairService.queryrepairRecord(inputObject, outputObject);
	}
	
}
